<?php
if ($admin_value['admin_type'] == 'Web Admin' || $admin_value['admin_type'] == 'Sub Admin') {
	$this -> admin = 'admin';
} else {
	$this -> admin = 'panelist';
}
$this -> load -> view('admin/head');
$this -> load -> view('admin/header');
?>
<!-- Content -->
<div class="space30"></div>
<div class="container">
	<div class="row">
		<div class="col-md-2">
			<nav class="navbar1">
				<?php $this->load->view('admin/left_nav'); ?>
			</nav>
		</div>
		<div class="col-md-10">

			<!--form starts-->
			<div class="form_container">
				<h4>Manage Event</h4>
				<!--row starts-->
				<div class="success_msg" style="margin-left:15px;">
					<?php 
						if($this->session->userdata('event_success')){
							echo $this->session->userdata('event_success');
							$this->session->set_userdata('event_success', '');
						}
					?>
				</div>
				<div class="row1">
					<?php echo form_open(BASE_URL.'/'.$this->admin.'/manage_event', array('id' => 'manage_search_form', 'method' => 'post'));?>
					<div class="form-group col-sm-12">
						<label for="event_name2">Search by Event Name</label>
						<input class="form-control white" id="event_search_name" name="event_search_name" required placeholder="Enter Event Name" type="text" value="<?php if(isset($search_tag) && $search_tag != ''){ echo $search_tag;} ?>">
						<div class="error" id="err-search"></div>
					</div>
					<div class="form-group col-sm-12">
						<button type="button" class="btn btn-primary" id="event_search_btn">
							Search
						</button>
					</div>
					<div class="clearfix"></div>
					<?php echo form_close(); ?>
				</div>
				<!--row closed-->
                
				<!--row starts-->
				<div class="row1">
					<div class="table-responsive">
						<table border="0" cellspacing="0" cellpadding="0" class="manage_table">
							<tr>
								<td width="8%">S.No.</td>
								<td width="24%">Event Name</td>
								<td width="15%">Created By</td>
								<td width="15%">Created Date</td>
                                <td width="14%">Edit Criteria Value</td>
								<td width="6%">Edit</td>
								<td width="7%" >Delete</td>
								<td width="11%">Status</td>
							</tr>
							<?php if(isset($search_value) && !empty($search_value)){
								foreach($search_value as $temp => $value){?>
							<tr>
								<td><?php echo $temp+1; ?></td>
								<td><?php if(isset($value['event_name'])){ echo ucfirst($value['event_name']);} ?></td>
								<td><?php if(isset($value['admin_fullname'])){ echo ucfirst($value['admin_fullname']);} ?></td>
								<td><?php if(isset($value['event_created_date'])){ echo date('d-m-Y',strtotime($value['event_created_date']));} ?></td>
                                 <td><a href="">Edit Criteria Value</a></td>
								<td><a href="javascript:void(0)" 
									onclick="edit_event('<?php if(isset($value['event_id'])){ echo $value['event_id'];} ?>','<?php echo BASE_URL.'/'.$this->admin; ?>')">
									<img src="<?php echo ASSET_URL; ?>img/admin/edit.png" style="width:20px;" alt="edit"></a>
								</td>
								<td><a href="javascript:void(0)" onclick="delete_event('<?php if(isset($value['event_id'])){ echo $value['event_id'];} ?>','<?php echo BASE_URL.'/'.$this->admin; ?>')"><img src="<?php echo ASSET_URL; ?>img/admin/delete.png" style="width:20px;" alt="delete"></a></td>
								<td><a href="javascript:void(0)" 
									onclick="status_event('<?php if(isset($value['event_id'])){ echo $value['event_id'];} ?>','<?php echo BASE_URL.'/'.$this->admin; ?>','<?php if(isset($value['event_status'])){ echo $value['event_status'];} ?>')">
									<img src="<?php echo ASSET_URL; ?>img/admin/<?php if(isset($value['event_status']) && $value['event_status']=='Inactive'){echo 'in';}?>active.png" style="width: 70px;" alt="status"></a>
								</td>
							</tr>
							<?php }}else{?>
								<tr><td colspan="7">No Record Found</td></tr>
							<?php }?>
						</table>
						<div class="space20"></div>
						<?php
							if(count($search_count) > '10')
							{
								$this->load->view('admin/manage_event/pagination');
							} 
						?>	
					</div>
				</div>
				<!--row closed-->
			</div>
			<!--form closed-->
			<div class="space30"></div>

		</div>
		<div class="clearfix"></div>
	</div>
</div>

<div class="space20"></div>

<div class="space30"></div>

<!-- Content End -->
<?php $this -> load -> view('common/footer'); ?>